import java.util.ArrayList;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Queue;

public class Test {
    /*public static void main(String[] args) {
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(3);
        LinkedList<Integer> linkedList = new LinkedList<>(arrayList);
        System.out.println(linkedList);
        for(Integer x: linkedList){
            System.out.print(x+" ");
        }
        System.out.println( );
        for (int i = 0; i < linkedList.size(); i++) {
            System.out.print(linkedList.get(i)+" ");
        }
        System.out.println( );
        ListIterator<Integer> it = linkedList.listIterator();//变送器
        while(it.hasNext()){
            System.out.print(it.next()+" ");
        }
        System.out.println( );
        ListIterator<Integer> rit = linkedList.listIterator(linkedList.size());//变送器
        while(rit.hasPrevious()){
            System.out.print(rit.previous()+" ");
        }
        System.out.println( );
    }*/
   /* public static void main2(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        System.out.println(myQueue.peek());
        myQueue.poll();
        System.out.println(myQueue.peek());
    }

    public static void main(String[] args) {
        Queue<Integer> myQueue = new LinkedList<>();
        myQueue.offer(1);
        myQueue.offer(2);
        System.out.println(myQueue.peek());
        myQueue.poll();
        System.out.println(myQueue.peek());
    }*/
    public static void main(String[] args) {
        BinayTree binayTree = new BinayTree();
        binayTree.createTree();
        binayTree.inOrder(binayTree.root);
        System.out.println();
        binayTree.postOrder(binayTree.root);
        System.out.println();
        /*binayTree.preOrder(binayTree.root);
        binayTree.size2(binayTree.root);
        System.out.print(BinayTree.nodeSize);*/
        binayTree.getLeafNodeCount(binayTree.root);
        System.out.print(binayTree.size5);


    }
}
